package com.gelsanalyzer.core;

// helper class for parsing out the actual data entered in GUI's ...
public class DataTransformer {
    // private constuctor so that we have a true static class...
    private DataTransformer() {
    };

    public static Integer stringToInt(String input) {
        Integer temp = null;
        try {
            temp = Integer.parseInt(input);
        } catch ( ClassCastException e ) {
            // catch the exception and just return null rather than taking down
            // the app...
            temp = null;
        }
        return temp;
    }

    public static double stringToDouble(String input) {
        Double temp = null;
        try {
            temp = Double.parseDouble(input);
        } catch ( ClassCastException e ) {
            // catch the exception and just return null rather than taking down
            // the app...
            temp = null;
        }
        return temp;

    }
}
